package com.cos.ssm1.web.controller;

import com.cos.ssm1.entity.Emp;
import com.cos.ssm1.services.EmpServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author: COS
 * @time: 2022/6/9 17:29
 * @description:
 */
@Controller
@RequestMapping("/emp")
public class EmpController {

    @Autowired
    private EmpServices empServices;
    @RequestMapping("/getAll")
    public String getAll(Model model){
        List<Emp> all = empServices.getAll();
        model.addAttribute("empList", all);
        return "index";
    }


}
